import 'package:backend.core/core/domain/entities/web/web_money_amount.dart';
import 'package:backend.purchases/domain/entities/yookassa_api/yookassa_api_money_amount.dart';

abstract class CreateWebMoneyAmountFromYookassaApiOne {
  WebMoneyAmount call({
    required YookassaApiMoneyAmount yookassaApiMoneyAmount,
  });
}

class CreateWebMoneyAmountFromYookassaApiOneImpl implements CreateWebMoneyAmountFromYookassaApiOne {
  const CreateWebMoneyAmountFromYookassaApiOneImpl();

  @override
  WebMoneyAmount call({
    required YookassaApiMoneyAmount yookassaApiMoneyAmount,
  }) {
    return WebMoneyAmount(
      value: yookassaApiMoneyAmount.value,
      currency: yookassaApiMoneyAmount.currency,
    );
  }
}
